Image coding apparatus, method for coding image, program therefor, image decoding apparatus, method for decoding image, and program therefor

ABSTRACT

An image coding method for dividing an input image into a plurality of divisional blocks having different sizes, and coding the image for each of the divisional blocks includes acquiring attribute information of a target block, setting a control parameter for controlling an image quality of the target block, determining a prediction control parameter based on the attribute information, calculating a difference value between the control parameter and the prediction control parameter, and coding the calculated difference value.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation, and claims the benefit, of U.S.patent application Ser. No. 14/003,771, presently pending and filed onSep. 6, 2013, that is a national phase application of internationalpatent application PCT/JP2012/001318 filed on Feb. 27, 2012, whichpatent(s) and patent applications are hereby incorporated by referenceherein in their entireties. This application also claims the benefit of,and priority to, Japanese Patent Application No. 2011-051269 filed Mar.9, 2011 which applications are hereby incorporated by reference hereinin their entireties.

TECHNICAL FIELD

The present invention relates to an image coding apparatus, a method forcoding an image, a program therefor, an image decoding apparatus, amethod for decoding an image, and a program therefor. More particularly,the present invention relates to a method for coding an image qualitycontrol parameter and a method for decoding an image quality controlparameter.

BACKGROUND ART

As a method for compressing and recording a moving image, MPEG-2 Video(hereafter referred to simply as MPEG-2) (ISO/IEC 13818-2:2000Information technique—Generic coding of moving pictures and associatedaudio information: Video) and H.264 (ISO/IEC 14496-10:2004 Informationtechnique—Coding of audio-visual targets—Part 10: Advanced Video Coding)are known. In recent years, the Joint Collaborative Team on Video Coding(JCT-VC) has been established as a collegial organization of the ITU-Tand ISO/IEC. This organization advances standardization activities forthe High Efficiency Video Coding (HEVC) which is a new moving imagestandard. For example, in a JCT-VC contribution JCTVC-A205.doc(http://wftp3.itu.int/av-arch/jctvc-site/2010_04_A_Dresden/), HEVCproposes an H.264-based improved technique.

With a coding method based on the orthogonal transform and quantizationrepresented by MPEG-2, H.264, and HEVC, the coding side appliesorthogonal transform and quantization to a predetermined block image togenerate quantization coefficient data. In this case, the coding methodcontrols the image quality by quantizing the image data by using animage quality control parameter which is called quantization parameter.Specifically, quantization by using a small quantization parameter valueimproves the image quality and increases the amount of codes, andquantization by using a large quantization parameter value degrades theimage quality and reduces the amount of codes. In the coding processing,the coding method codes the image data while selecting an optimumquantization parameter value according to a target amount of codes inthis way. This method is referred to as rate control with which TM5(MPEG-2 Test Model 5 (TM5), Doc. ISO/IEC JTC1/SC29/WG11/N0400, TestModel Editing Committee, April 1993) and other various methods have beenproposed. Japanese Patent Application Laid-Open No. 2001-45494 discussesa technique for determining the visual importance of an image area andcontrolling an image quality control parameter according to theimportance.

Variable-length coding is applied to quantized quantization coefficientdata to generate variable-length coding coefficient data. Thequantization parameter is also coded to generate a quantizationparameter code. For example, a quantization parameter generation methoduses as a predictive quantization parameter a quantization parameterused to quantize a block quantized before a block subjected toquantization, and calculates a difference value between the predictivequantization parameter and a quantization parameter used to quantize theblock subjected to quantization. This difference value, calledQuantization Parameter Delta (QP_DELTA), is embedded in a bit stream asa quantization parameter code. The variable-length coding coefficientdata and the quantization parameter code generated in this way aretransmitted as a bit stream to a decoding unit via an optical diskmedium or a network. The decoding side decodes the variable-lengthcoding coefficient data and the quantization parameter code to generatequantization coefficient data and a quantization parameter, and appliesinverse orthogonal transform and inverse quantization to thequantization coefficient data by using the quantization parameter togenerate a decoded image.

With MPEG-2 and H.264, processing is performed in unit of a latticeblock formed of 16×16 pixels formed by dividing an image called amacroblock. When the size of a block subjected to orthogonal transformis represented in pixel units, the block size is 8×8 pixels with MPEG-2,or 8×8 pixels or 4×4 pixels with H.264. Specifically, one macroblockincludes a plurality of orthogonal transform blocks. Since MPEG-2 orH.264 enables controlling the quantization parameter in macroblock units(rate control), orthogonal transform blocks included in an identicalmacroblock are quantized based on a similar quantization parameter.

With HEVC, on the other hand, lattice blocks formed by dividing an imagein lattice form are called Largest Coding Units (LCUs) each being formedof 64×64 pixels. Each LCU is divided into a plurality of smaller-sizedblocks called Coding Units (CUs) by using the region quadtree structure.Each CU includes orthogonal transform blocks called Transform Units(TUs). Each TU is further divided into a plurality of smaller-sizedblocks by using the region quadtree structure. Each unit of aquantization parameter has a division flag. A block having a Truedivision flag includes four divisional blocks each being horizontallyand vertically half in size of the block. A block having a Falsedivision flag does not include divisional blocks but has actual data ofthe block. There are various methods for determining whether a block isto be divided. As a method for determining whether a block is to bedivided, Japanese Patent Application Laid-Open No. 2005-191706 discussesa technique for calculating a cost of blocks by using the Lagrangemultiplier and selecting a block division method with a lowest cost.

With a quantization parameter coding method for coding as a quantizationparameter code a difference value between a quantization parameter and apredictive quantization parameter of a block subjected to coding, theamount of quantization parameter codes increases with increasingabsolute value of the difference value. When embedding a quantizationparameter in block units in a conventional case, since there is only onemethod for calculating a predictive quantization parameter, the absolutevalue of the difference value increases, thus resulting in anunnecessarily increased amount of quantization parameter codes dependingon the image coding method and image characteristics.

SUMMARY OF INVENTION

The present invention is directed to preventing an unnecessary increasein the amount of quantization parameter codes and to reducing the amountof quantization parameter codes.

According to an aspect of the present invention, an image coding methodfor dividing an input image into a plurality of divisional blocks havingdifferent sizes, and coding the image for each of the divisional blocksincludes: acquiring attribute information of a target block; setting acontrol parameter for controlling an image quality of the target block;determining a prediction control parameter based on the attributeinformation; calculating a difference value between the controlparameter and the prediction control parameter; and coding thecalculated difference value.

According to an exemplary embodiment of the present invention, theamount of quantization parameter codes can be reduced.

Further features and aspects of the present invention will becomeapparent from the following detailed description of exemplaryembodiments with reference to the attached drawings.

BRIEF DESCRIPTION OF DRAWINGS

The accompanying drawings, which are incorporated in and constitute apart of the specification, illustrate exemplary embodiments, features,and aspects of the invention and, together with the description, serveto explain the principles of the invention.

FIG. 1 is a flowchart illustrating a divisional block coding methodaccording to a first exemplary embodiment of the present invention.

FIG. 2 is a flowchart illustrating a divisional block coding methodaccording to a third exemplary embodiment of the present invention.

FIG. 3 is a flowchart illustrating a divisional block coding methodaccording to a fifth exemplary embodiment of the present invention.

FIG. 4 is a flowchart illustrating a divisional block coding methodaccording to a seventh exemplary embodiment of the present invention.

FIG. 5 is a flowchart illustrating a divisional block coding methodaccording to a ninth exemplary embodiment of the present invention.

FIG. 6 is a flowchart illustrating a divisional block decoding methodaccording to a second exemplary embodiment of the present invention.

FIG. 7 is a flowchart illustrating a divisional block decoding methodaccording to a fourth exemplary embodiment of the present invention.

FIG. 8 is a flowchart illustrating a divisional block decoding methodaccording to a sixth exemplary embodiment of the present invention.

FIG. 9 is a flowchart illustrating a divisional block decoding methodaccording to an eighth exemplary embodiment of the present invention.

FIG. 10 is a flowchart illustrating a divisional block decoding methodaccording to a tenth exemplary embodiment of the present invention.

FIG. 11A illustrates a hardware configuration according to exemplaryembodiments of the present invention.

FIG. 11B illustrates a hardware configuration according to exemplaryembodiments of the present invention.

FIG. 11C illustrates a hardware configuration according to exemplaryembodiments of the present invention.

FIG. 12A illustrates a relation between positions of neighboring blocks.

FIG. 12B illustrates a relation between positions of neighboring blocks.

FIG. 13A illustrates example block division.

FIG. 13B illustrates example block division.

FIG. 14 is a table illustrating relations between block positions, andidentification value conversion.

FIG. 15 is a flowchart illustrating a method for coding a frame.

FIG. 16 is a flowchart illustrating a method for decoding a frame.

FIG. 17 illustrates an example configuration of a bit stream of a frame.

FIG. 18A illustrates an example configuration of bit streams of latticeblocks.

FIG. 18B illustrates an example configuration of bit streams of latticeblocks.

FIG. 19A illustrates an example division state of lattice blocks anddivision flags.

FIG. 19B illustrates an example division state of lattice blocks anddivision flags.

FIG. 19C illustrates an example division state of lattice blocks anddivision flags.

FIG. 19D illustrates an example division state of lattice blocks anddivision flags.

FIG. 20 is a flowchart illustrating a predicted image quality controlparameter acquisition method for each block size of a divisional block.

FIG. 21 is a flowchart illustrating processing for determining apredicted image quality control parameter based on an intra-predictionmethod.

FIG. 22 illustrates referential relations between image quality controlparameters of respective blocks.

FIG. 23A illustrates an example operation of the divisional block codingmethod according to the fifth exemplary embodiment of operation.

FIG. 23B illustrates an example operation of the divisional block codingmethod according to the fifth exemplary embodiment of operation.

FIG. 23C illustrates an example operation of the divisional block codingmethod according to the fifth exemplary embodiment of operation.

FIG. 23D illustrates an example operation of the divisional block codingmethod according to the fifth exemplary embodiment of operation.

FIG. 24A illustrate an example predicted image quality control parameteracquisition method.

FIG. 24B illustrate the example predicted image quality controlparameter acquisition method.

FIG. 25 is illustrates an index indicating prediction directions inintra-prediction.

DESCRIPTION OF EMBODIMENTS

Various exemplary embodiments, features, and aspects of the inventionwill be described in detail below with reference to the drawings.

A method for coding a block subjected to coding according to a firstexemplary embodiment of the present invention will be described belowwith reference to FIGS. 1, 11A, 11B, 11C, 15, and 20.

FIG. 11A illustrates a hardware configuration for executing a codingprogram including the coding method according to the first exemplaryembodiment. This coding program is recorded on a hard disk drive(hereinafter referred to as HDD) 1104. When the coding program isactivated, it is loaded into a read-only memory (RAM) 1102, and acentral processing unit (CPU) 1101 executes each step of the codingprogram described below to perform coding processing. In the presentexemplary embodiment, input image data is stored in the HDD 1104 and, acoded bit stream is also recorded on the HDD 1104. Coding processingwith the above-mentioned configuration will be described below. In thepresent exemplary embodiment, a frame is divided into a plurality oflattice blocks each being formed of 64×64 pixels (hereinafter, a blockformed of nxn pixels is referred to as an nxn block). Each lattice blockis further divided, by using the region quadtree structure, into aplurality of divisional blocks each being formed of at least 8×8 pixels.Division blocks are subjected to coding processing. FIG. 13A illustratesan example state where a frame is divided into a plurality of latticeblocks. FIG. 13B illustrates an example state where a lattice block isfurther divided into a plurality of divisional blocks. Even when alattice block is left undivided, processing is performed on the premisethat the lattice block includes one 64×64 divisional block.

FIG. 15 is a flowchart illustrating processing for coding the entireframe. In step S15010, the CPU 1101 codes the frame header information.The frame header information includes a frame synchronization code, andframe type information indicating whether the frame is an intra-frame oran inter-frame.

In step S15020, the CPU 1101 sets a lattice block subjected toprocessing (hereinafter referred to as target lattice block). A targetlattice block subjected to the first processing is a lattice block atthe top left corner of a frame. Subsequently, each time step S15020 isexecuted, a lattice block is set in order of raster scanning, forexample, in order of lattice block numbers (B1, B2, . . . ) illustratedin FIG. 13A.

In step S15030, the CPU 1101 determines a division state of the targetlattice block and a prediction mode (described below) of each divisionalblock therein. The target lattice block is divided into a plurality ofdivisional blocks by using the region quadtree structure, as illustratedin FIG. 13B. In the present exemplary embodiment, the prediction modeindicates an intra-prediction mode and an inter-prediction mode. Theintra-prediction mode is a mode in which an intra-predicted image blockis generated referring to neighboring divisional blocks of a divisionalblock subjected to processing (hereinafter referred to as targetdivisional block) as is the case with H.264, and the inter-predictionmode is a mode in which a motion compensation predicted image block isgenerated by determining a motion vector.

In step S15031, the CPU 1101 codes prediction mode information anddivisional block information of divisional blocks in the target latticeblock. The prediction mode information includes a prediction mode flagand additional information about the prediction mode. For example, inthe intra-prediction mode, the additional information isintra-prediction method information. In the inter-prediction mode, theadditional information is motion vector information or motion vectorderivation block identification information for identifying aneighboring block having a similar motion vector as the targetdivisional block. For example, the motion vector derivation blockidentification information is composed of a 1-bit motion vectoridentification flag and a motion vector prediction direction flag. Whenthe motion vector identification flag is 1, the motion vector predictiondirection flag is embedded but a motion vector is not. Otherwise, whenthe motion vector identification flag is 0, a motion vector is embeddedbut the motion vector prediction direction flag is not. Further, whenthe motion vector prediction direction flag is 1, a motion vector of theleft block is considered as a motion vector of the target block.Otherwise, when the motion vector prediction direction flag is 0, amotion vector of the upper block is considered as a motion vector of thetarget block. When embedding the motion vector derivation blockidentification information, a motion vector can be derived from themotion vector derivation block identification information in decodingprocessing without embedding the motion vector information in a bitstream. Although, in the present exemplary embodiment, the motion vectorprediction direction flag is handled as a 1-bit flag, the flagconfiguration is not limited thereto. The motion vector predictiondirection flag may be a multivalued flag to enable selection from aplurality of block candidates including the upper left and upper rightblocks, etc., in addition to the upper and left blocks. Similar to theprediction mode with the 16×16 intra-prediction block in H.264, theintra-prediction method information is used to identify, for example,horizontal prediction, vertical prediction, DC prediction, and planarprediction.

A prediction mode information code, i.e., variable-length codedprediction mode information, is embedded in a bit stream. The divisionalblock information is information about a division state indicatingwhether each node (block) of the region quadtree structure is to befurther divided into smaller divisional blocks. The divisional blockinformation for a certain node (block) is considered as a division flag.For example, when a lattice block is divided into divisional blocks asillustrated in FIG. 13B, division states for different block sizes areas illustrated in FIGS. 19A, 19B, 19C, and 19D. FIGS. 19A, 19B, 19C, and19D illustrate division states of 64×64, 32×32, 16×16, and 8×8 blocks,respectively. The division state (1) indicates that the block is furtherdivided into smaller blocks, and the division state (0) indicates thatthe block is left undivided. Reference numerals N1, N2, . . . , N21indicate node (block) numbers for the region quadtree structure. Thesenode numbers set the order of scanning the region quadtree structure bydepth priority search in each layer, and the scanning order of the upperleft, upper right, lower left, and lower right blocks within anidentical block (hereinafter referred to as the order of the regionquadtree structure). “-” indicates that no node (block) exists. Bytransmitting as divisional block information the division flags of nodenumbers N1, N2, . . . , N21 to the decoding unit, the region quadtreestructure can be reconstructed also on the side of the decoding unit.The prediction mode information code and division flag are embedded in abit stream for each divisional block, for example, in a structure asillustrated in FIG. 18A. Referring to FIG. 18A, node numbers N1, N2, . .. , N21 correspond to node (block) numbers in FIGS. 19A, 19B, 19C, and19D, and reference numerals b1, b2, . . . , b16 correspond to divisionalblock numbers in FIG. 13B. With node numbers N1, N2, . . . , N21, theprediction mode information is added only to blocks no longer dividable,i.e., divisional blocks corresponding to reference numerals b1, b2, . .. , b16.

In step S15040, the CPU 1101 sets a target divisional block. At thefirst time, the CPU 1101 sets the upper left block in the lattice block.Subsequently, each time step S15040 is executed, the CPU 1101 sets adivisional block in order of the region quadtree structure, for example,in order of the divisional block numbers b1, b2, . . . , b16 illustratedin FIG. 13B.

In step S15050, the CPU 1101 codes the target divisional block set instep S15040. Detailed processing in this step will be described below.In step S15060, the CPU 1101 determines whether processing is completedfor all divisional blocks in the target lattice block. When processingis completed for all divisional blocks in the target lattice block (YESin step S15060), the processing proceeds to S15070. Otherwise, whenprocessing is not completed for all divisional blocks in the targetlattice block (NO in step S15060), the processing returns to stepS15040. When processing is completed for all divisional blocks for onelattice block, a bit stream of the lattice block, having a structure asillustrated in FIG. 18A, is generated.

In step S15070, the CPU 1101 determines whether processing is completedfor all lattice blocks in the frame. When processing is completed forall lattice blocks in the frame (YES in step S15070), the processingexits the flowchart in FIG. 15. Otherwise, when processing is notcompleted for all lattice blocks in the frame (NO in step S15070), theprocessing returns to step S15020. When processing is completed for alllattice blocks in the frame, a bit stream of the frame, having astructure as illustrated in FIG. 17A, is generated.

FIG. 1 is a detailed flowchart illustrating the divisional block codingmethod executed in step S15050 in FIG. 15.

In step S1010, the CPU 1101 acquires attribute information of the targetdivisional block. Although, in the present exemplary embodiment, theblock size is used as attribute information, the attribute informationis not limited thereto. For example, the attribute information may beblock mode information for identifying intra- and inter-prediction, amotion vector, or an intra-prediction method in intra-prediction. Usingthese pieces of attribute information alone or in combination, an imagequality control parameter of a last coded divisional block having asimilar attribute as the target divisional block may be used as apredicted image quality control parameter. The motion vector does notneed to be identical, and may be regarded as identical if an absolutevalue of a vector difference is equal to or less than a fixed value.

In step S1020, the CPU 1101 calculates an image quality controlparameter of the target divisional block. The image quality controlparameter is calculated so that, for example, the amount of frame codesbecomes a preset target value. In this case, the image quality controlparameter can be adjusted so that each region has a different imagequality control parameter aiming at improving the image quality of aregion having specific image components, such as a human face, an objectedge, etc.

In step S1030, the CPU 1101 acquires an image quality control parameterof a last coded divisional block having a similar attribute as thetarget divisional block, as a prediction control parameter. In thepresent exemplary embodiment, since the block size is used as attributeinformation, the CPU 1101 records, updates, and refers to the imagequality control parameter for each block size. Detailed processing inthis step will be described below.

In step S1040, the CPU 1101 calculates a difference value between theimage quality control parameter of the target divisional block and thepredicted image quality control parameter to acquire an image qualitycontrol parameter difference value.

In step S1050, the CPU 1101 codes the image quality control parameterdifference value to generate an image quality control parameterdifference value code. The image quality control parameter differencevalue code is embedded in a bit stream in a structure as illustrated inFIG. 18A.

In step S1060, the CPU 1101 codes the image data of the targetdivisional block. In the present exemplary embodiment, according to theprediction mode, the CPU 1101 generates residual data of the targetdivisional block and applies orthogonal transform, quantization, andvariable-length coding to the residual data to code the residual dataand generate variable-length coding coefficient data. In this case, thevariable-length coding coefficient data is embedded in a bit stream inthe structure as illustrated in FIG. 18A.

FIG. 20 is a flowchart illustrating a predicted image quality controlparameter acquisition method for each block size determined in stepS1030 in FIG. 1. In this flowchart, final image quality controlparameters 64, 32, 16, and 8 are used. These parameters are commonlyused in processing in the frame, and are to be initialized when decodingis started or for each processing unit such as frame and slice.

In step S20001, the CPU 1101 determines the block size of the targetblock, and performs processing for each block size. Specifically, whenthe block size is 64×64, 32×32, 16×16, and 8×8 pixels (64×64, 32×32,16×16, and 8×8 in step S20001, respectively), the processing proceeds tosteps S20002 and S20003, steps S20004 and S20005, steps S20006 andS20007, and steps S20008 and S20009, respectively.

In step S20002, the final image quality control parameter 64 is set as apredicted image quality control parameter.

In step S20003, the CPU 1101 records the image quality control parameterof the target divisional block to the final image quality controlparameter 64. Recording a parameter value in this way enables easilyreferring to the parameter value next time a 64×64 block is processed.

Subsequently, when the block size is 32×32, 16×16, 8×8 pixels, the CPU1101 executes similar processing in steps S20004 and S20005, stepsS20006 and S20007, and steps S20008 and S20009, respectively. Apredicted image quality control parameter acquired in these steps willbe used in step S1040.

FIG. 22 illustrates referential relations between image quality controlparameters of respective blocks by using arrows. Referring to FIG. 22,for example, when a block B2 is a target divisional block, an imagequality control parameter of a last coded block B1 having a similarblock size as the target divisional block is set as a predicted imagequality control parameter of the block B2. When a block C5 is a targetdivisional block, an image quality control parameter of a last codedblock C4 having a similar block size as the target divisional block isset as a predicted image quality control parameter of the block C5.Thus, in the present exemplary embodiment, image quality controlparameters of blocks having different sizes are referred to as predictedimage quality control parameters independently for each block size. Inmany cases, blocks having a similar attribute are coded based on imagequality control parameters having identical or close values. Forexample, there is a tendency that the coding efficiency is improved bycoding an image block having many low-frequency components based on alarge block size and by coding an image block having many high-frequencycomponents, such as an edge, based on a small block size. Therefore, theblock size at the time of block division is also likely to be determinedaccording to this tendency. When controlling image quality controlparameters aiming at improving the image quality of a region having aspecific image component, image quality control parameters are highlylikely to have close values for each block size. Therefore, thetechnique according to the present exemplary embodiment provides asmaller absolute value of a difference value than a case of calculatinga difference value simply by using an image quality control parameter ofa last coded block, as a predicted image quality control parameter. Thismeans that the technique provides a smaller amount of codes at the timeof image quality control parameter coding.

Although, in the present exemplary embodiment, the lattice block size is64×64 pixels and the minimum divisional block size is 8×8 pixels, theblock size is not limited thereto. Further, the coding method accordingto the present exemplary embodiment may be configured by dedicatedhardware such as an orthogonal transform unit 1003, a quantization unit1004, and a variable-length coding unit 1005, as illustrated in FIG.11B. Further, the image quality control parameter calculation methodaccording to the present exemplary embodiment may be configured bydedicated hardware such as a code amount control unit (not illustrated).In this case, the CPU 1101 executes similar processing to the flowchartsin FIGS. 1 and 15. However, the CPU 1101 does not execute orthogonaltransform processing, quantization processing, variable-length codingprocessing, and control processing, but instructs the hardware toexecute these pieces of processing.

An image decoding method according to a second exemplary embodiment ofthe present invention for decoding coded data generated by the imagecoding method according to the first exemplary embodiment will bedescribed below with reference to FIGS. 6, 11A, 11B, 11C, 16, and 20.

FIG. 11A illustrates a hardware configuration for executing a decodingprogram including the decoding method according to the second exemplaryembodiment. Decoding processing is achieved when the CPU 1101 loads thedecoding program from the HDD 1104 into the RAM 1102, and executes eachstep of a flowchart (described below). Input code data is read from theHDD 1104 and a decoded image is output to a display via a video RAM(VRAM) 1105. Although the decoding processing is performed on a blockbasis, a decoded image for one frame is completed when decoded images ofblocks acquired by decoding respective blocks are copied to a suitableposition in the RAM 1102 and the decoding processing is completed forall blocks of one frame ends. Then, the generated frame is output to theVRAM 1105.

An input bit stream is the bit stream generated in the first exemplaryembodiment.

FIG. 16 is a flowchart illustrating processing for decoding the inputbit stream. Each lattice block is decoded in order of raster scanning.

In step S16010, the CPU 1101 decodes the frame header informationillustrated in FIG. 17A. In step S16020, the CPU 1101 sets a targetlattice block subjected to processing. The target lattice blocksubjected to the first processing is the lattice block at the top leftcorner of the screen. Subsequently, each time step S16020 is executed,the CPU 1101 sets a target lattice block in order of raster scanning,for example, in order of the lattice block numbers (B1, B2, . . . )illustrated in FIG. 13A.

In step S16030, the CPU 1101 decodes the division state of the targetlattice block, and the prediction mode for each divisional block. Inthis step, the region quadtree structure of divisional blocks isrestored based on the division flag. Prediction mode information is alsodecoded for each divisional block, and the attribute information of eachdivisional block can be acquired.

In step S16040, the CPU 1101 sets a target divisional block based on theorder of the region quadtree structure restored in step S16030, forexample, in order of the divisional block number (b1, b2, . . . )illustrated in FIG. 13B. In step S16050, the CPU 1101 decodes image dataof the target divisional block. Detailed processing in this step will bedescribed below with reference to FIG. 6.

In step S16060, the CPU 1101 determines whether processing is completedfor all divisional blocks in the lattice block. When processing iscompleted for all divisional blocks (YES in step S16060), the processingproceeds to perform S16070. Otherwise, when processing is not completedfor all divisional blocks (NO in step S16060), the processing returns tostep S16040.

In step S16070, the CPU 1101 determines whether processing is completedfor all lattice blocks in the frame. When processing is completed forall lattice blocks (YES in step S16070), the processing exits thisflowchart. Otherwise, when processing is not completed for all latticeblocks (NO in step S16070), the processing returns to step S16020 toreexecute steps S16020 to S16070.

FIG. 6 is a detailed flowchart illustrating processing executed instepS16050 in FIG. 16. Instep S6010, the CPU 1101 acquires attributeinformation of the target divisional block. Although, in the presentexemplary embodiment, the block size is used as attribute information,the attribute information is not limited thereto. In step S6020, the CPU1101 decodes the image quality control parameter difference value codeto generate an image quality control parameter difference value. In stepS6030, the CPU 1101 sets a last decoded divisional block havingattribute information identical to that of the target divisional blockacquired in step S6010, as a predicted image quality control parameter.In the present exemplary embodiment, since the block size is used asattribute information, the CPU 1101 records and refers to an imagequality control parameter for each block size.

In step S6040, the CPU 1101 adds the image quality control parameterdifference value to the predicted image quality control parameter tocalculate an image quality control parameter of the target block.

In step S6050, the CPU 1101 decodes the image data of the targetdivisional block. In the decoding processing for a target blockaccording to the present exemplary embodiment, the CPU 1101 appliesvariable-length decoding, inverse quantization, and inverse orthogonaltransform to variable-length coding coefficient data to generateresidual data. Further, according to the prediction mode, the CPU 1101generates a predicted image and adds the residual data to the predictedimage to obtain a decoded image of the divisional block. At the time ofinverse quantization, the CPU 1101 uses the image quality controlparameter calculated in step S6040 as a quantization parameter.

Applying the technique according to the second exemplary embodimentenables decoding a bit stream coded by the image coding method accordingto the first exemplary embodiment.

The decoding method according to the second exemplary embodiment may beconfigured by dedicated hardware such as an inverse orthogonal transformunit 1304, an inverse quantization unit 1305, a variable-length decodingunit 1306, and a code amount control unit (not illustrated), asillustrated in FIG. 11C. In this case, the CPU 1101 executes similarprocessing to the flowcharts in FIGS. 6 and 16. However, the CPU 1101does not execute inverse orthogonal transform, inverse quantization, andvariable-length decoding processing, but instructs the hardware toexecute these pieces of processing.

An image coding method according to a third exemplary embodiment of thepresent invention will be described below with reference to FIG. 2.Unless otherwise described, the configuration and processing of eachstep in the present exemplary embodiment are similar to those of thefirst exemplary embodiment.

FIG. 2 is a detailed flowchart illustrating a divisional block codingmethod. In this flowchart, step S2021 is added following step S1020 inFIG. 1. In the third exemplary embodiment, the target divisional blockis an inter-block.

In step S2021, the CPU 1101 selects one neighboring block havingattribute information closest to that of the target divisional block.FIG. 12B illustrates a relation between the motion vector of the targetdivisional block and motion vectors of neighboring blocks. Although, inthe present exemplary embodiment, neighboring blocks are considered tobe blocks to the left, upside, and upper right of the target block asillustrated in FIG. 12B, the combination of blocks is not thereto.Although, in the present exemplary embodiment, selecting a block havingattribute information closest to that of the target divisional block isequivalent to selecting a block providing a smallest difference valuebetween the motion vector of the target divisional block and each ofmotion vectors of neighboring blocks, the processing is not limitedthereto. When there is motion vector derivation block identificationinformation for identifying a neighboring block having a similar motionvector as the target divisional block, the information may be used toselect a block. Referring to FIG. 12B, for example, the targetdivisional block has a motion vector VCurr, the left block has a motionvector VLeft, the upper block has a motion vector VTop, and the upperright block has a motion vector VTopRight. In this case, since themotion vectors VCurr and VTop have a similar vector value, the upperblock is selected. Although, in the present exemplary embodiment, when aplurality of blocks has closest or identical attribute information, aspatially closest block is selected, but the processing is not limitedthereto.

In step S2030, the CPU 1101 sets the image quality control parameter ofthe block selected in step S2021 as a predicted image quality controlparameter.

In many cases, a neighboring block having a similar attribute as thetarget divisional block is coded based on an image quality controlparameter having an identical or close value. For example, blocks havinga similar motion vector are highly likely to be included in a similarobject. When performing processing for improving the image quality of aspecific object, blocks having a similar motion vector are highly likelyto be coded based on image quality control parameters having closevalues. Therefore, this technique provides a smaller absolute value of adifference value than a case of calculating a difference value simply byusing an image quality control parameter of a last coded block, as apredicted image quality control parameter. This means that the techniqueprovides a smaller amount of codes at the time of image quality controlparameter coding. Therefore, a moving image having the equivalent imagequality can be coded with a less bit rate.

An image decoding method according to a fourth exemplary embodiment ofthe present invention for decoding coded data generated by the imagecoding method according to the third exemplary embodiment will bedescribed below with reference to FIG. 7. Unless otherwise described,the configuration and processing of each step in the present exemplaryembodiment are similar to those of the second exemplary embodiment. Aninput bit stream is the bit stream generated in the third exemplaryembodiment.

FIG. 7 is a detailed flowchart illustrating the divisional blockdecoding processing in step S16050 in FIG. 16. In this flowchart, stepS7021 is added following step S6020 in FIG. 6. In the fourth exemplaryembodiment, the target block is an inter-block.

In step S7021, the CPU 1101 selects one neighboring block havingattribute information closest to that of the target divisional block.Referring to FIG. 12B, similar to the third exemplary embodiment, sincethe motion vectors VCurr and VTop have a similar vector value, the upperblock is selected. In this case, motion vectors maybe directly comparedto select a block. When there exists information for identifying aneighboring block having a similar motion vector as the targetdivisional block, the information may be used to select a block.Although, in the present exemplary embodiment, when a plurality ofblocks has closest or identical attribute information, a spatiallyclosest block is selected, but the processing is not limited thereto.

In step S7030, the CPU 1101 sets the image quality control parameter ofthe block selected in step S6021 as a predicted image quality controlparameter. The predicted image quality control parameter determined herewill be used in step S6040. Applying the technique according to thepresent exemplary embodiment enables decoding a bit stream coded by theimage coding method according to the third exemplary embodiment.

An image coding method according to a fifth exemplary embodiment of thepresent invention will be described below with reference to FIG. 3.Unless otherwise described, the configuration and processing of eachstep in the present exemplary embodiment are similar to those of thefirst exemplary embodiment.

FIG. 3 is a detailed flowchart illustrating the divisional block codingmethod illustrated in step S15050 in FIG. 15. In this flowchart, stepS3021 is added following step S1020 in FIG. 1.

In step S3021, the CPU 1101 selects at least one neighboring blockhaving similar attribute information as the target divisional block.Although, in the present exemplary embodiment, neighboring blocks areconsidered to be blocks to the left, upside, and upper right of thetarget block as illustrated in FIG. 12A, the combination of blocks isnot limited thereto. In the present exemplary embodiment, the block modeinformation is used as attribute information. Specifically, when thetarget divisional block is an intra-block, the CPU 1101 selects aneighboring intra-block. When the target divisional block is aninter-block, the CPU 1101 selects a neighboring inter-block.

In step S3030, the CPU 1101 calculates an average of image qualitycontrol parameters of at least one selected block, and sets it as apredicted image quality control parameter. Although, in the presentexemplary embodiment, an average is used as a predicted image qualitycontrol parameter, the predicted image quality control parameter is notlimited thereto, and may be a median.

FIGS. 23A, 23B, 23C, and 23D illustrate example processing according tothe fifth exemplary embodiment. Referring to FIG. 23A, since a block tothe left of the target divisional block is an inter-block, the leftblock is selected. Referring to FIG. 23B, since a block to the upside ofthe target divisional block is an inter-block, the upper block isselected. Referring to FIG. 23C, since blocks to the left and upside ofthe target divisional block are inter-blocks, an average of the left andupper blocks is selected. Referring to FIG. 23D, since blocks to theleft and upside of the target divisional block are not inter-blocks, theleft block is selected.

In many cases, a neighboring block having a similar attribute as thetarget divisional block is coded based on an image quality controlparameter having an identical or close value. For example, a block at anedge portion of a moving subject is easily coded by intra-coding, and ablock on the background or in a subject is easily coded by inter-coding.When performing code amount control for improving the image qualitygiving priority to an edge portion, it is effective to set an imagequality control parameter to intra-coding blocks aiming for high imagequality. Specifically, image quality control parameters of blocks havingsimilar block mode information tend to have close values. Therefore, thetechnique according to the fifth exemplary embodiment provides a smallerabsolute value of a difference value than a case of calculating adifference value simply by using an image quality control parameter of alast coded block, as a predicted image quality control parameter. Thismeans that the technique provides a smaller amount of codes at the timeof image quality control parameter coding.

An image decoding method according to a sixth exemplary embodiment ofthe present invention for decoding coded data generated by the imagecoding method according to the fifth exemplary embodiment will bedescribed below with reference to FIG. 8. Unless otherwise described,the configuration and processing of each step in the present exemplaryembodiment are similar to those of the second exemplary embodiment. Aninput bit stream is the bit stream generated in the fifth exemplaryembodiment.

FIG. 8 is a detailed flowchart illustrating the divisional blockdecoding processing in step S16050 in FIG. 16. In this flowchart, stepS8021 is added following step S6020 in FIG. 6.

In step S8021, the CPU 1101 selects at least one neighboring blockhaving similar attribute information as the target divisional block.Although, in the sixth exemplary embodiment, neighboring blocks areconsidered to be blocks to the left, upside, and upper right of thetarget block as illustrated in FIG. 12A, the combination of blocks isnot limited thereto. Specifically, when the target divisional block isan intra-block, the CPU 1101 selects a neighboring intra-block. When thetarget divisional block is an inter-block, the CPU 1101 selects aneighboring inter-block.

In step S8030, the CPU 1101 calculates an average of image qualitycontrol parameters of at least one selected block, and sets it as apredicted image quality control parameter. Although, in the sixthexemplary embodiment, an average is used as a predicted image qualitycontrol parameter, the predicted image quality control parameter is notlimited thereto, and may be a median. The predicted image qualitycontrol parameter determined here will be used in step S6040.

Applying the technique according to the sixth exemplary embodimentenables decoding a bit stream coded by the image coding method accordingto the fifth exemplary embodiment.

An image coding method according to a seventh exemplary embodiment ofthe present invention will be described below with reference in FIG. 4.Unless otherwise described, the configuration and processing of eachstep in the present exemplary embodiment are similar to those of thefirst exemplary embodiment.

FIG. 4 is a flowchart illustrating a divisional block coding methodillustrated in step S15050 in FIG. 15. In this flowchart, steps S4021,S4022, and S4023 are added following step S1020 in FIG. 1.

In step S4021, the CPU 1101 selects a predicted image quality controlparameter determination method from a plurality of candidates. Although,in the present exemplary embodiment, the CPU 1101 selects a predictedimage quality control parameter determination method out of thefollowing four different methods ((0), (1), (2), and (3)), thecombination is not limited thereto, and may be other determinationmethods or a part of the four methods. (0) Set an image quality controlparameter of a divisional block spatially existing to the left of thetarget divisional block, as a predicted image quality control parameter.(1) Set an average of image quality control parameters of neighboringdivisional blocks having similar attribute information as the targetdivisional block, as a predicted image quality control parameter. (2)Set a median of image quality control parameters of neighboringdivisional blocks having similar attribute information as the targetdivisional block, as a predicted image quality control parameter. (3)Set an image quality control parameter of a last coded divisional blockhaving similar attribute information as the target divisional block, asa predicted image quality control parameter. As concrete processing instep S4021, the CPU 1101 attempts the above-mentioned predicted imagequality control parameter determination methods, and selects a predictedimage quality control parameter determination method which provides asmallest difference value between the image quality control parameter ofthe target divisional block and the predicted image quality controlparameter.

In step S4022, the CPU 1101 determines an identification value foridentifying the predicted image quality control parameter determinationmethod. In the present exemplary embodiment, the CPU 1101 sets an indexvalue corresponding to the predicted image quality control parameterdetermination method determined in step S4021, as an identificationvalue.

In step S4023, the CPU 1101 codes the above-mentioned identificationvalue to generate an identification value code.

In step S4030, the CPU 1101 acquires a predicted image quality controlparameter calculated by the predicted image quality control parameterdetermination method selected in step S4021.

FIG. 18B illustrates a structure of a bit stream of a lattice blockaccording to the seventh exemplary embodiment. Transmitting the bitstream to the decoding unit enables identifying the predicted imagequality control parameter determination method also on side of thedecoding unit.

According to the seventh exemplary embodiment, an optimum predictedimage quality control parameter determination method can be selected. Inthe present exemplary embodiment, an optimum predicted image qualitycontrol parameter determination method is selected for each divisionalblock, and then the identification value is coded. However, theprocessing is not limited thereto. It is also possible to select anoptimum predicted image quality control parameter determination methodin unit of lattice block, slice, frame, or sequence, and embed theidentification value in the header of the above-mentioned coding unit.For example, the identification value is embedded in the frame header inFIG. 17A.

An image decoding method according to an eighth exemplary embodiment ofthe present invention for decoding coded data generated by the imagecoding method according to the seventh exemplary embodiment will bedescribed below with reference in FIG. 9. Unless otherwise described,the configuration and processing of each step in the present exemplaryembodiment are similar to those of the second exemplary embodiment. Aninput bit stream is the bit stream generated in the seventh exemplaryembodiment.

FIG. 9 is a detailed flowchart illustrating the divisional blockdecoding processing in step S16050 in FIG. 16. In this flowchart, stepS9021 is added following step S6020 in FIG. 2. In the eighth exemplaryembodiment, the CPU 1101 decodes the bit stream generated in the seventhexemplary embodiment illustrated in FIG. 18B.

In step S6010, the CPU 1101 acquires attribute information of the targetdivisional block. Although, in the eighth exemplary embodiment, theblock mode information for identifying intra- and inter-prediction isused as attribute information, the attribute information is not limitedthereto. For example, the block size, motion vector, or intra-predictionmethod in intra-prediction may be used alone or in combination.

In step S9021, the CPU 1101 decodes the identification value code foridentifying the predicted image quality control parameter determinationmethod to generate an identification value. In the eighth exemplaryembodiment, although the identification value corresponds to (0), (1),(2), and (3) described in the seventh exemplary embodiment, theidentification value is not limited thereto.

In step S9030, the CPU 1101 determines a predicted image quality controlparameter by using the predicted image quality control parameterdetermination method identified by the above-mentioned identificationvalue. The predicted image quality control parameter determined herewill be used in step S6040.

The decoding method according to the eighth exemplary embodiment enablesdecoding a bit stream coded by the image coding method according to theseventh exemplary embodiment.

An image coding method according to a ninth exemplary embodiment of thepresent invention will be described below with reference in FIG. 5.Unless otherwise described, the configuration and processing of eachstep in the present exemplary embodiment are similar to those of thefirst exemplary embodiment.

FIG. 5 is a detailed flowchart illustrating the divisional block codingprocessing in step S15050 in FIG. 15. In this flowchart, step S5021 isadded following step S1020 in FIG. 1, and steps S5041 and S5042 areadded following step S5040.

In step S5021, the CPU 1101 selects a plurality of neighboring blockshaving similar attribute information as the target divisional block.Although, in the present exemplary embodiment, blocks to the left,upside, and upper right of the target block are selected as illustratedin FIG. 12A, the combination is not limited thereto. Although, in theninth exemplary embodiment, all of the left, upper, and upper rightblocks are selected when they have different modes, the combination isnot limited thereto.

In step S5030, the CPU 1101 calculates a difference value between theimage quality control parameter of the target divisional block and eachof image quality control parameters of the selected blocks, and selectsa block providing a smallest difference value. In step S5040, the CPU1101 acquires a difference value calculated by using the image qualitycontrol parameter of the block selected instep S5030. This differencevalue will be coded in step S1050.

In step S5041, the CPU 1101 calculates an identification value foridentifying a block subjected to image quality control parameterprediction out of the plurality of blocks. For example, thisidentification value can be calculated with reference to a table in FIG.14. Referring to FIG. 14, “SELECTION OF BLOCK HAVING SIMILAR ATTRIBUTE”indicates whether divisional blocks existing to the left, upside, andupper right of the target divisional block are selected or not in stepS5021. Identification codes in this table are assigned according to“SELECTION OF BLOCK HAVING SIMILAR ATTRIBUTE”, and the identificationcodes corresponding to the left, upper, and upper right divisionalblocks selected in step S5021 are used as identification values. In thetable, “-” indicates that no identification code is assigned since noblock is selected, and “x” indicates that a block can be uniquelyidentified even without coding the identification value.

In step S5042, the CPU 1101 codes the above-mentioned identificationvalue to generate an identification value code. In the ninth exemplaryembodiment, the CPU 1101 codes the above-mentioned identification valueby using the coding method described in column “CODING METHOD” accordingto “SELECTION OF BLOCK HAVING SIMILAR ATTRIBUTE” in FIG. 14. In cases 1and 8 in FIG. 14, the CPU 1101 generates variable-length Golomb codesand embeds them in a bit stream. In cases 2, 3, and 5 in FIG. 14, theCPU 1101 embeds values in a bit stream as 1-bit fixed length data. Incases 4, 6, and 7 in FIG. 14, the identification value code is notembedded in a bit stream since blocks can be uniquely identified.However, the coding method is not limited thereto.

According to the ninth exemplary embodiment, it is possible to selectfor each divisional block a neighboring divisional block having apredicted image quality control parameter that minimizes the amount ofimage quality control parameter codes of the target divisional block.

An image decoding method according to a tenth exemplary embodiment ofthe present invention for decoding coded data generated by the imagecoding method according to the ninth exemplary embodiment will bedescribed below with reference in FIG. 10. Unless otherwise described,the configuration and processing of each step in the present exemplaryembodiment are similar to those of the second exemplary embodiment. Aninput bit stream is the bit stream generated in the ninth exemplaryembodiment.

FIG. 10 is a detailed flowchart illustrating the divisional block codingprocessing in step S16050 in FIG. 16. In this flowchart, steps S10021,S10022, and S10023 are added following step S6020 in FIG. 6.

In step S10021, the CPU 1101 selects a plurality of neighboringdivisional blocks having similar attribute information as the targetdivisional block. Although, in the present exemplary embodiment, blocksto the left, upside, and upper right of the target block are selected asillustrated in FIG. 12A, the combination is not limited thereto as longas the attribute information is similar as the coding method. Although,in the ninth exemplary embodiment, all of the left, upper, and upperright blocks are selected when all of them have different modes, thecombination is not limited thereto as long as the attribute informationis similar to the coding method.

In step S10022, the CPU 1101 decodes the identification value based onthe identification value code. Although, in the tenth exemplaryembodiment, the CPU 1101 decodes the above-mentioned identificationvalue by using the decoding method corresponding to the coding methoddescribed in column “CODING METHOD” according to “SELECTION OF BLOCKHAVING SIMILAR ATTRIBUTE” in FIG. 14, the processing is not limitedthereto. In cases 2, 3, and 5 in FIG. 14, since a block can be uniquelyidentified and the identification value code is not embedded in a bitstream, the identification value code is not decoded.

In step S10023, the CPU 1101 selects a divisional block used forpredicted image quality control parameter calculation based on theidentification value. Specifically, in the present exemplary embodiment,the CPU 1101 identifies the left, upper, and upper right blocks based on“SELECTION OF BLOCK HAVING SIMILAR ATTRIBUTE” and the identificationvalue in FIG. 14. Also in cases where the identification value code isnot decoded in step S10022, the CPU 1101 can select one prediction blockbased on “SELECTION OF BLOCK HAVING SIMILAR ATTRIBUTE” in FIG. 14. Theblock selected here will be used in step S6030.

The decoding method according to the tenth exemplary embodiment enablesdecoding a bit stream coded by the image coding method according to theninth exemplary embodiment.

An image coding method according to a eleventh exemplary embodiment ofthe present invention will be described below with reference in FIG. 21.Unless otherwise described, the configuration and processing of eachstep in the present exemplary embodiment are similar to those of thefirst exemplary embodiment.

In the present exemplary embodiment, the target divisional block is anintra-block. Although the prediction method for intra-prediction is anyof DC prediction, horizontal prediction, vertical prediction, and planarprediction similar to the 16×16 intra-prediction block in H.264, theprediction method is not limited thereto.

FIG. 21 is a flowchart illustrating processing for determining apredicted image quality control parameter based on the intra-predictionmethod in step S1030 in FIG. 1.

In step S21001, the CPU determines the intra-prediction method of thetarget divisional block. When the intra-prediction method is horizontaldirection prediction (HORIZONTAL DIRECTION PREDICTION in step S21001),the processing proceeds to step S21002. When the intra-prediction methodis DC prediction or planar prediction (DC PREDICTION or PLANARPREDICTION in step S21001), the processing proceeds to step S21003. Whenthe intra-prediction method is vertical direction prediction (VERTICALDIRECTION PREDICTION in step S21001), the processing proceeds to stepS21004.

In step S21002, the CPU 1101 sets the image quality control parameter ofthe divisional block existing to the left of the target divisionalblock, as a predicted image quality control parameter.

In step S21003, the CPU 1101 sets an average of image quality controlparameters of the divisional blocks existing to the left and upside ofthe target divisional block, as a predicted image quality controlparameter.

In step S21004, the CPU 1101 sets the image quality control parameter ofthe divisional block existing to the upside of the target divisionalblock, as a predicted image quality control parameter.

However, the combination of the intra-prediction method and divisionalblocks used for predicted image quality control parameter calculation isnot limited thereto. For example, when the intra-prediction method has34 directions as illustrates in FIG. 25, the CPU 1101 calculatespredicted image quality control parameters as illustrated in FIG. 24A.In this case, when an index for indicating the prediction direction is18, 10, or 19, for example, the CPU 1101 calculates an average of imagequality control parameters of the divisional blocks existing to the leftand upside of the target divisional block (top left and top in FIG.24B), as a predicted image quality control parameter of the targetdivisional block.

Blocks existing in the prediction direction of intra-prediction arehighly likely to be included in a similar object. When performingprocessing for improving the image quality of a specific object, theseblocks are highly likely to be coded based on image quality controlparameters having similar values. Therefore, the technique according tothe eleventh exemplary embodiment provides a smaller absolute value of adifference value than a case of calculating a difference value simply byusing an image quality control parameter of a last coded block, as apredicted image quality control parameter. This means that the techniqueprovides a smaller amount of codes at the time of image quality controlparameter coding.

An image decoding method for decoding coded data generated by the imagecoding method according to the eleventh exemplary embodiment will bedescribed below with reference in FIG. 21. Unless otherwise described,the configuration and processing of each step in the present exemplaryembodiment are similar to those of the second exemplary embodiment. Aninput bit stream is the bit stream generated in the eleventh exemplaryembodiment.

In a twelfth exemplary embodiment of the present invention, the targetdivisional block is an intra-block. Although the prediction method forintra-prediction is any of DC prediction, horizontal prediction,vertical prediction, and planar prediction similar to the 16×16intra-prediction block in H.264, the prediction method is not limitedthereto.

In step S6030 in FIG. 6, the CPU 1101 determines a predicted imagequality control parameter based on the intra-prediction method followingthe flowchart in FIG. 21.

In step S21001, the CPU determines the intra-prediction method of thetarget divisional block. When the intra-prediction method is horizontaldirection prediction (HORIZONTAL DIRECTION PREDICTION in step S21001),the processing proceeds to step S21002. When the intra-prediction methodis DC prediction or planar prediction (DC PREDICTION or PLANARPREDICTION in step S21001), the processing proceeds to step S21003. Whenthe intra-prediction method is vertical direction prediction (VERTICALDIRECTION PREDICTION in step S21001), the processing proceeds to stepS21004.

In step S21002, the CPU 1101 sets the image quality control parameter ofthe divisional block existing to the left of the target divisionalblock, as a predicted image quality control parameter.

In step S21003, the CPU 1101 sets an average of image quality controlparameters of the divisional blocks existing to the left and upside ofthe target divisional block, as a predicted image quality controlparameter.

In step S21004, the CPU 1101 sets the image quality control parameter ofthe divisional block existing to the upside of the target divisionalblock, as a predicted image quality control parameter.

However, the combination of the intra-prediction method and thedivisional blocks used for predicted image quality control parametercalculation is not limited thereto as long as the attribute informationis similar to the coding method.

Applying the technique according to the twelfth exemplary embodimentenables decoding a bit stream coded by the image coding method accordingto the eleventh exemplary embodiment.

An image coding method according to a thirteenth exemplary embodiment ofthe present invention will be described below with reference in FIG. 2.Unless otherwise described, the configuration and processing of eachstep in the present exemplary embodiment are similar to those of thefirst and third exemplary embodiments.

In step S2021, the CPU 1101 selects a neighboring divisional blockhaving similar attribute information as the target divisional block. Inthe thirteenth exemplary embodiment, a motion vector is used asattribute information. In the example in FIG. 12B, since the motionvectors VCurr and VTop have a similar vector value, the upper block isselected.

In step S2030, the CPU sets the image quality control parameter of theblock selected in step S2021 as a predicted image quality controlparameter.

In the thirteenth exemplary embodiment, in the case of a similardifference value between the motion vector of the target divisionalblock and each of motion vectors of neighboring blocks (calculated instep S2021), the image quality control parameter difference value codeis not embedded in a bit stream. When the image quality controlparameter difference value code is not embedded in a bit stream, the CPU1101 skips steps S1040 and S1050 not to embed the image quality controlparameter difference value code. In image block coding in step S1060,the CPU 1101 does not use the image quality control parameter calculatedin step S1020. Instead, the CPU 1101 uses the predicted image qualitycontrol parameter determined in step S2030 as a parameter for imagequality control.

It is useful to code a neighboring block having a similar attribute asthe target divisional block, based on a similar image quality controlparameter. For example, blocks having a similar motion vector as thetarget divisional block are highly likely to be included in a similarobject. In this case, coding these blocks based on the similar imagequality control parameter prevents an image quality difference fromoccurring in the similar object. By not embedding an image qualitycontrol parameter difference value in a bit stream, a moving imagehaving the equivalent image quality can be coded with a less bit rate.

It is also possible to insert into a bit stream a code for identifyingthe existence of a neighboring block having a similar motion vector asthe target divisional block and the position of the relevant neighboringblock. When there exists a neighboring block having a similar motionvector as the target divisional block, the above-mentioned processingwithout embedding an image quality control parameter difference valuecode is performed. In this case, a motion vector is not embedded in thetarget divisional block. Applying the present exemplary embodimentfurther enables reducing the amount of codes at the time of imagequality control parameter coding.

An image decoding method according to a fourteenth exemplary embodimentof the present invention for decoding a bit stream coded by the imagecoding method according to the first and thirteenth exemplaryembodiments will be described below with reference in FIG. 7. Unlessotherwise described, the configuration and processing of each step inthe present exemplary embodiment are similar to those of the second andfourth exemplary embodiments.

In step S7021, the CPU 1101 selects a neighboring divisional blockhaving similar attribute information as the target divisional block. Inthe fourteenth exemplary embodiment, a motion vector is used asattribute information. In the example in FIG. 12B, since motion vectorsVCurr and VTop have a similar vector value, the upper block is selected.

In step S7030, the CPU 1101 sets the image quality control parameter ofthe block selected in step S7021 as a predicted image quality controlparameter. The predicted image quality control parameter determined herewill be used in step S6040. In the present exemplary embodiment, in thecase of a similar difference value between the motion vector of thetarget divisional block and each of motion vectors of neighboring blocks(calculated in step S7021), the image quality control parameterdifference value code is not decoded. When the image quality controlparameter difference value code is not decoded, the CPU 1101 skips stepsS6020 and S6040 and, in image block decoding in step S7040, uses thepredicted image quality control parameter determined in step S7030 as aparameter for image quality control.

Applying the technique according to the fourteenth exemplary embodimentenables decoding a bit stream coded by the image coding method accordingto the third exemplary embodiment.

Also when a bit stream includes a code for identifying the existence ofa neighboring block having a similar motion vector as the targetdivisional block and the position of the relevant neighboring block, theabove-mentioned image quality control parameter difference value codemay not decoded. In this case, the predicted image quality controlparameter is the image quality control parameter of a block having asimilar motion vector as the target divisional block, identified by theabove-mentioned code. It is necessary that these pieces of processingcorrespond to the processing of the coding method.

Although, in the above-described exemplary embodiments, coded data isrecorded on a HDD 903, the recording form of coded data is not limitedthereto. For example, coded data maybe recorded on a recording mediumother than a hard disk drive. Further, coded data may be transmitted toa communication line via a communication interface 905, or recorded on aportable medium in a connected external recording device.

Although, in the above-described exemplary embodiments, software isrecorded on a hard disk drive, the recording form of software is notlimited thereto. For example, the software may be recorded on a hardwareunit such as a ROM or a portable medium such as a memory card and adisk.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all modifications, equivalent structures, and functions.

1. An image coding apparatus for dividing an image into a plurality ofblocks and coding the image for each of the blocks, the image codingapparatus comprising: a quantization parameter determination unitconfigured to determine a first quantization parameter to be used forquantization of a first block; a prediction mode determination unitconfigured to determine, in a case where the first block is coded withintra-prediction, an intra-prediction mode in the intra-prediction forthe first block; a block determination unit configured to determine atleast one second block for coding information indicating the firstquantization parameter from blocks in an area different from the firstblock, on the basis of the intra-prediction mode for the first block;and a coding unit configured to code, as the information, a differencevalue between the first quantization parameter and a quantizationparameter of the at least one second block or a value based on thequantization parameter of the at least one second block.
 2. The imagecoding apparatus according to claim 1, wherein the at least one secondblock is a block coded before the first block.
 3. The image codingapparatus according to claim 1, wherein, in a case where the at leastone second block comprises a plurality of second blocks, the value basedon the quantization parameter of the at least one second block is anaverage or a median of a plurality of quantization parameters of theplurality of second blocks.
 4. The image coding apparatus according toclaim 1, wherein the at least one second block is a block adjacent tothe first block on left, upper, or upper right.
 5. The image codingapparatus according to claim 1, wherein the at least one second block isa block based on a direction indicated by the intra-prediction mode forthe first block.
 6. The image coding apparatus according to claim 1,wherein in a case where the intra-prediction mode for the first block isa horizontal mode, the at least one second block is a block existing ina left direction of the first block.
 7. The image coding apparatusaccording to claim 1, wherein, in a case where the at least one secondblock comprises a plurality of second blocks and in a case where theintra-prediction mode for the first block is a DC mode or a planar mode,the plurality of second blocks is a block existing in a left directionof the first block and a block existing in an upper direction of thefirst block.
 8. The image coding apparatus according to claim 1, whereinin a case where the intra-prediction mode for the first block is avertical mode, the at least one second block is a block existing in anupper direction of the first block.
 9. An image decoding apparatus fordecoding coded data generated by coding individual blocks of an image,the image decoding apparatus comprising: a decoding unit configured todecode, from the coded data, a difference value regarding a firstquantization parameter used for inverse quantization of a first block; aderiving unit configured to derive, in a case where the first block isdecoded with intra-prediction, information indicating anintra-prediction mode in the intra-prediction for the first block fromthe coded data; a determination unit configured to determine at leastone second block for deriving the first quantization parameter fromblocks in an area different from the first block on the basis of theintra-prediction mode for the first block; and a calculation unitconfigured to calculate the first quantization parameter on the basis ofthe difference value regarding the first quantization parameter and aquantization parameter of the at least one second block or a value basedon the quantization parameter of the at least one second block.
 10. Theimage decoding apparatus according to claim 9, wherein the at least onesecond block is a block decoded before the first block.
 11. The imagedecoding apparatus according to claim 9, wherein, in a case where the atleast one second block comprises a plurality of second blocks, the valuebased on the quantization parameter of the at least one second block isan average or a median of a plurality of quantization parameters of theplurality of second blocks.
 12. The image decoding apparatus accordingto claim 9, wherein the at least one second block is a block adjacent tothe first block on left, upper, or upper right.
 13. The image decodingapparatus according to claim 9, wherein the at least one second block isa block based on a direction indicated by the intra-prediction mode forthe first block.
 14. The image decoding apparatus according to claim 9,wherein in a case where the intra-prediction mode for the first block isa horizontal mode, the at least one second block is a block existing ina left direction of the first block.
 15. The image decoding apparatusaccording to claim 9, wherein, in a case where the at least one secondblock comprises a plurality of second blocks and in a case where theintra-prediction mode for the first block is a DC mode or a planar mode,the plurality of second blocks is a block existing in a left directionof the first block and a block existing in an upper direction of thefirst block.
 16. The image decoding apparatus according to claim 9,wherein in a case where the intra-prediction mode for the first block isa vertical mode, the at least one second block is a block existing in anupper direction of the first block.
 17. An image coding method fordividing an image into a plurality of blocks and coding the image foreach of the blocks, the image coding method comprising: determining afirst quantization parameter to be used for quantization of a firstblock; determining, in a case where the first block is coded withintra-prediction, an intra-prediction mode in the intra-prediction forthe first block; determining at least one second block for codinginformation indicating the first quantization parameter from blocks inan area different from the first block, on the basis of theintra-prediction mode for the first block; and coding, as theinformation, a difference value between the first quantization parameterand a quantization parameter of the at least one second block or a valuebased on the quantization parameter of the at least one second block.18. An image decoding method for decoding coded data generated by codingindividual blocks of an image, the image decoding method comprising:decoding, from the coded data, a difference value regarding a firstquantization parameter used for inverse quantization of a first block;deriving, in a case where the first block is decoded withintra-prediction, information indicating an intra-prediction mode in theintra-prediction for the first block from the coded data; determining atleast one second block for deriving the first quantization parameterfrom blocks in an area different from the first block on the basis ofthe intra-prediction mode for the first block; and calculating the firstquantization parameter on the basis of the difference value regardingthe first quantization parameter and a quantization parameter of the atleast one second block or a value based on the quantization parameter ofthe at least one second block.
 19. A non-transitory computer readablestorage medium for storing a computer program for executing an imagecoding method for dividing an image into a plurality of blocks andcoding the image for each of the blocks, the image coding methodcomprising: determining a first quantization parameter to be used forquantization of a first block; determining, in a case where the firstblock is coded with intra-prediction, an intra-prediction mode in theintra-prediction for the first block; determining at least one secondblock for coding information indicating the first quantization parameterfrom blocks in an area different from the first block, on the basis ofthe intra-prediction mode for the first block; and coding, as theinformation, a difference value between the first quantization parameterand a quantization parameter of the at least one second block or a valuebased on the quantization parameter of the at least one second block.20. A non-transitory computer readable storage medium for storing acomputer program for executing an image decoding method for decodingcoded data generated by coding individual blocks of an image, the imagedecoding method comprising: decoding, from the coded data, a differencevalue regarding a first quantization parameter used for inversequantization of a first block; deriving, in a case where the first blockis decoded with intra-prediction, information indicating anintra-prediction mode in the intra-prediction for the first block fromthe coded data; determining at least one second block for deriving thefirst quantization parameter from blocks in an area different from thefirst block on the basis of the intra-prediction mode for the firstblock; and calculating the first quantization parameter on the basis ofthe difference value regarding the first quantization parameter and aquantization parameter of the at least one second block or a value basedon the quantization parameter of the at least one second block.